package com.zhkj.txg.module.mine.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.txg.R
import com.zhkj.txg.module.mine.entity.NotificationEntity
import com.zhkj.txg.module.mine.ui.NotificationDetailActivity

class NotificationAdapter : BaseQuickAdapter<NotificationEntity, BaseViewHolder>(R.layout.item_notification),
    LoadMoreModule {

    init {
        setOnItemClickListener { _, _, position ->
            NotificationDetailActivity.open(context, data[position])
        }
    }

    override fun convert(helper: BaseViewHolder, item: NotificationEntity) {
        helper.setText(R.id.tvNotificationDate, item.createText)
            .setText(R.id.tvNotificationTitle, item.title)
            .setText(R.id.tvNotificationContent, item.content)
    }
}